<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
            <h1>总分：{{sum}}</h1>
            <h1>总分：{{sum}}</h1>
            <h1>总分：{{sum}}</h1>
            <button @click = "">添加分数</button>

            
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                scores:[100,20,30,40,50,60,70,80,90,100],
                sum:0
            },
            methods: {

            },
            watch:{
                scores :{
                    immediate:true,
                    handler(){
                        console.log("scores数据发生改变");
                        
                    }
                }
            }
        })
    </script>
</body>

</html>